<?php
/**
 * Define a custom exception class
 */
class VNException extends Exception{

	private $class;
	public function __Construct($message, $code = 0,$class=false) {

		// construct the parent Exception class
		$this->class = $class;
		parent::__Construct($message, $code);

	}

	// custom string representation of object
	public function __toString() {
		if($class){
			return "\r\n<strong id='error'>[{$this->code}]: {$this->message}</strong><br/>\n";
		}
		return "\r\n<strong id='error'>{$this->class}\r\n[{$this->code}]: {$this->message}</strong><br/>\n";
	}

	public function customFunction() {
		print "A custom function for this type of exception\n";
	}
}
?>
